//
//  Settings.h
//  sad
//
//  Created by Christopher Kemsley on 2/3/12.
//  Copyright (c) 2012 iAppolopolis. All rights reserved.
//

#ifndef sad_Settings_h
#define sad_Settings_h

#include "IAAny.hpp"
#include <string>
#include <map>





struct	Settings
{
	typedef std::map<std::string,Any>	Variables ;
	
	
	Settings ( std::string const & name )
	:	mVariables() , mInstanceName(name) { }
	
	
	template <typename Type>
	void	add		( char const* name , Type & storage )
		{
		mVariables[name] = &storage ;
		}
	
	Variables const&	variables () const
		{
		return mVariables ;
		}
	std::string const&	instanceName () const
		{
		return mInstanceName ;
		}
	virtual void		validate () // called from codec
		{
		
		}
	
	
private:
	Variables	mVariables ;
protected:
	std::string const	mInstanceName ;
	
	
private: // disabled by lack of delcaration
	Settings () ;
	Settings ( Settings const & c ) ;
} ;






#endif
